console.log("node version: ", process.versions.node);
const { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("myApi", {
  version: process.version,
  saveFile: (data) => {
    console.log("send", data);
    ipcRenderer.send("file-save", data);
  },
  readFile() {
    return ipcRenderer.invoke("file-read");
  },
  getMessage: (callback) => {
    return ipcRenderer.on("message", callback);
  },
});
